﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Ecreate.Web.usercontrol
{
    public partial class ucCopyright : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string sql = "select * from t_info_dtl";
            System.Data.DataTable dt = GG.GetTable(sql);
            l1.Text = GetText(dt, "公司地址");
            l2.Text = GetText(dt, "邮政编码");
            l3.Text = GetText(dt, "版权所有");
            l4.Text = GetText(dt, "执照号");
            l5.Text = GetText(dt, "免费电话");
            l6.Text = GetText(dt, "备案号");
        }

        private string GetText(System.Data.DataTable dt, string key)
        {
            string text = "";
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                string keyname = dr["keyname"].ToString();
                if (keyname.Contains(key))
                {
                    string keyvalue = dr["keyvalue"].ToString();
                    text = keyname + keyvalue;
                    break;
                }
            }
            return text;
        }
    }
}